﻿Imports System.Collections.Generic
Imports System.ComponentModel

Namespace NCS
    ''' <summary>
    '''	
    ''' </summary>
    <Serializable()> _
    Public Class powerSet

        'public event PropertyChangedEventHandler PropertyChanged;
        'protected void OnPropertyChanged(string name)
        '{
        '    PropertyChangedEventHandler handler = PropertyChanged;
        '    if (handler != null)
        '    {
        '        handler(this, new PropertyChangedEventArgs(name));
        '    }
        '}

#Region "构造方法"
        Public Sub New()
            m_ID = 0
            m_begin_power = 0
            m_end_power = 0
            m_time = 0
            m_sn = 0
        End Sub
#End Region


#Region "私有变量"
        Private m_ID As Integer
        Private m_methodid As Integer
        Private m_begin_power As Integer
        Private m_end_power As Integer
        Private m_time As Integer
        Private m_method As method
        Private m_sn As Integer
#End Region


#Region "公有属性"
        Public Overridable Property method() As method
            Get
                Return m_method
            End Get
            Set(ByVal value As method)
                m_method = value
            End Set
        End Property
       

        Public Overridable Property id() As Integer
            Get
                Return m_ID
            End Get
            Set(ByVal value As Integer)
                m_ID = value
            End Set
        End Property
        Public Overridable Property sn() As Integer
            Get
                Return m_sn
            End Get
            Set(ByVal value As Integer)
                m_sn = value
            End Set
        End Property
        '''<summary>
        '''
        '''</summary>
        'Public Overridable Property methodid() As Integer
        '    Get
        '        Return m_methodid
        '    End Get
        '    Set(ByVal value As Integer)
        '        m_methodid = value
        '    End Set
        'End Property

        '''<summary>
        '''
        '''</summary>
        Public Overridable Property begin_power() As Integer
            Get
                Return m_begin_power
            End Get
            Set(ByVal value As Integer)
                m_begin_power = value
            End Set
        End Property
        Public Overridable Property end_power() As Integer
            Get
                Return m_end_power
            End Get
            Set(ByVal value As Integer)
                m_end_power = value
            End Set
        End Property
        Public Overridable Property time() As Integer
            Get
                Return m_time
            End Get
            Set(ByVal value As Integer)
                m_time = value
            End Set
        End Property
#End Region

#Region "Rewrite Equals and HashCode"
        ''' <summary>
        ''' 
        ''' </summary>
        Public Overloads Overrides Function Equals(ByVal obj As Object) As Boolean
            If Me Is obj Then
                Return True
            End If
            If (obj Is Nothing) OrElse (obj.[GetType]() IsNot [GetType]()) Then
                Return False
            End If
            Dim castObj As powerSet = DirectCast(obj, powerSet)
            Return (castObj IsNot Nothing) AndAlso (m_ID = castObj.id)
        End Function
        ''' <summary>
        ''' 用唯一值实现GetHashCode
        ''' </summary>
        Public Overloads Overrides Function GetHashCode() As Integer
            Dim hash As Integer = 57
            hash = 27 * hash * m_ID.GetHashCode()
            Return hash
        End Function
#End Region
    End Class
End Namespace
